﻿
using System ;
using System.Diagnostics ;
using System.Reflection ;


namespace MskEdit.Sdk
{

    public static class SdkDiagnostics
    {
        public static void TraceWarning( string msg, int lineNo ) {
        
            StackTrace stackTrace   = new StackTrace() ;
            StackFrame stackFrame   = stackTrace.GetFrame( 1 ) ;
            MethodBase methodBase   = stackFrame.GetMethod() ;
            
            string from = methodBase.ReflectedType.Name + "." + methodBase.Name + "()" ;
            
            Trace.WriteLine( "Warning " + from ) ;
            Trace.WriteLine( "        Line no " + lineNo.ToString() ) ;
            Trace.WriteLine( "        " + msg ) ;
        }
    }
}
